#include "bsp_exit.h"
#include "bsp_delay.h"
#include "bsp_led.h"
#include "bsp_beep.h"
#include "bsp_epit.h"
#include "bsp_keyfilter.h"

static void key_handler(int key)
{
    static unsigned char state = ON;
    beep_switch(state);
    // beep_switch(ON);
    state = !state;
    
}

void test_main_keyfilter()
{
    led_init();
    beep_init();
    keyfilter_init();
    keyfilter_enable(key_handler);
    beep_switch(ON);
    delay(500);
    beep_switch(OFF);
    while(1)
    {
        led_switch(0, ON);
        delay(500);
        led_switch(0, OFF);
        delay(500);
    }
}